<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
var minCount = function(coins) {
    let count = 0
    for( var i = 0 ; i<coins.length ; i++ ){
        if( coins[i] <=2 ){
            count++
            continue
        }
        if( coins[i] % 2 == 1 ){
            count = count + Math.floor( coins[i] / 2 ) +1
        }
        if( coins[i] % 2 == 0 ){
            count = count + ( coins[i] / 2 )
        }
    }
    return count
};

var coins = [2,3,10]
console.log(minCount(coins))
    </script>
</body>
</html>